package com.qg.utils;

import org.apache.activemq.command.ActiveMQQueue;
import org.apache.activemq.command.ActiveMQTempQueue;
import org.springframework.jms.core.JmsMessagingTemplate;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import javax.jms.Destination;

@Component
public class ActieMQaUtil {

    @Resource
    private JmsMessagingTemplate jmsMessagingTemplate;

    /**
     * 发送队列消息
     * @param name
     * @param message
     */
    public void sendQueueMesage(String name,Object message){
        Destination destination=new ActiveMQQueue(name);
        jmsMessagingTemplate.convertAndSend(destination,message);
    }
}
